<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
</head>
<body>
     <input type="text" id="s" value="请输入要搜索的内容..." style="color:#ccc">

    <hr>
    <h4>说点什么:</h4>
    <textarea name="weibo" id="weibo" cols="30" rows="5" onkeyup="ck(this)" maxlength="140"></textarea>
    <p>
        您还能输入 <font size="7" color="#f00" id="ts">140</font> 个字
    </p>

</body>
    <script>
        var s = document.getElementById("s");

        s.onfocus = function(){
            this.value = "";
            this.color = "#000";
        }


        var weibo = document.getElementById("weibo");
        var ts = document.getElementById("ts");
        weibo.onkeyup = function(){
            ts.innerHTML = 140-weibo.value.length;
        }

        document.onmouseup = function(){
            ts.innerHTML = 140-weibo.value.length;
        }
    </script>
</html>